﻿using pcEntity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;

namespace pcDAL
{
    public class SiteDAL
    {
        public List<SelectListItem> GetEmploymentTypes(int companyId)
        {
            List<SelectListItem> empTypes = new List<SelectListItem>();
            using (var context = new PunchClockEntities())
            {
                var _empTypes = (from et in context.tEmploymentTypes
                            select new
                            {
                                id = et.EmploymentTypeId,
                                name = et.EmploymentTypeName
                            }).ToList();
                empTypes = _empTypes.Select(x => new SelectListItem
                {
                    Text = x.name,
                    Value = Convert.ToString(x.id)
                }).ToList();
            }
            return empTypes;
        }
    }
}
